﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAL;
using System.Data;

namespace logic
{
    public class sellerRange
    {
        public static void insert(SellerRangeEntity sr)
        {
            SellerRange.insert(sr);
        }

        public static void updateCancel(SellerRangeEntity sr)
        {
            SellerRange.updateCancel(sr);
        }

        public static SellerRangeEntity getById(int srId)
        {
            return SellerRange.getById(srId);
        }

        public static DataTable getProductByCompany(int companyId, int categoryId)
        {
            return SellerRange.getProductByCompany(companyId,categoryId);
        }

        public static void delete(int srId,int adminId)
        {
            SellerRange.delete(srId,adminId);
        }

        public static DataSet select(string where, string orderby, int pagesize, int pageindex)
        {
            return DAL.DbHelper.ExecuteDataSetPageSize("*", "vw_SellerRange_list", where, "srId", orderby, pagesize, pageindex);
        }

        public static DataSet listWithBusinessNature(string where, string orderby, int pagesize, int pageindex)
        {
            return DAL.DbHelper.ExecuteDataSetPageSize("*", "[dbo].[vw_sellerRangeProduct_withBusinessNature]", where, "srId", orderby, pagesize, pageindex);
        }

        public static DataTable list()
        {
            return SellerRange.list();
        }

        public static void deleteBySelected(string srIds, int sellerid,int adminId)
        {
            SellerRange.deleteBySelected(srIds,sellerid,adminId);
        }

        public static void insertBySelected(string productIds, int sellerid)
        {
            SellerRange.insertBySelected(productIds,sellerid);
        }

        public static DataTable getByCompanyId(int companyid)
        {
            return SellerRange.getByCompanyId(companyid);
        }

        public static DataSet sellerRangelistWithPrice(int companyId, string where, int pageIndex, int pageSize)
        {
            return SellerRange.sellerRangelistWithPrice(companyId, where, pageIndex, pageSize);
        }

        public static DataSet snnightOrderOptimize(string where, string orderby, int pagesize, int pageindex)
        {
            return SellerRange.snnightOrderOptimize(where, orderby, pagesize, pageindex);
        }

        public static void setFavourite(int srId)
        {
            SellerRange.setFavourite(srId);
        }

        public static bool IsSupply(int companyId, int productId,string businessNature)
        {
            return SellerRange.IsSupply(companyId,productId,businessNature);
        }

        public static void sellerRangeBypricebusinessNature(int sellerId)
        {
            SellerRange.sellerRangeBypricebusinessNature(sellerId);
        }

        public static DataSet exportBySellerId(int companyId)
        {
            return SellerRange.exportBySellerId(companyId);
        }
    }
}
